import { postSearchGoods } from "@/api";

const state={
    searchList:{}
};
const mutations={
    RECEIVE_SEARCHLIST(state,searchList){
        state.searchList=searchList
    }
};
const actions={
    async getSearchList({commit},searchParams){
        try {
        const result=await postSearchGoods(searchParams)
        if(result && result.code===200){
            commit('RECEIVE_SEARCHLIST',result.data)
        }
        } catch (error) {
            console.log(error);
        }
    }
};
const getters={};
export default {
    state,
    mutations,
    actions,
    getters
}